#include<stdio.h>
#include<string.h>
#include<stdlib.h>
typedef unsigned float_bits;
int float_f2i(float_bits f)
{
int exp,frac,E;
int  s=f&0x80000000;
exp=(f>>23)&0xff;
frac=(f&0x7fffff)|(1<<23);
E=exp-127;
if(E<0)return 0;
if(E>30) return 0x80000000;
if(E<=23){
frac=frac>>(23-E);
    if(s>>31) return -frac; 
    else return frac;}
else {frac=frac<<(E-23);
if(s>>31) return -frac; 
    else return frac;}
}

int main()
{
int x=0x4640E400;
double y=0x7ff80007;
printf("please input x,y:");
scanf("%d%ld",&x,&y);
int m;
m=float_f2i(x);
printf("%d-->%d\n",x,m);
m=float_f2i(y);
printf("%ld->%x\n",y,m);

}
